fix(dav): Strip DTSTAMP before etag comparison in webcal refresh#58193
Open
Olen wants to merge 1 commit intonextcloud:masterfrom
Open
fix(dav): Strip DTSTAMP before etag comparison in webcal refresh#58193Olen wants to merge 1 commit intonextcloud:masterfrom
Olen wants to merge 1 commit intonextcloud:masterfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DTSTAMPfrom etag computation inRefreshWebcalServiceto prevent false change detectionProblem
Many iCal providers (Google Calendar, Outlook 365, itslearning) set
DTSTAMPto the current UTC time on every feed request per RFC 5545. Since Nextcloud computes the etag asmd5(serialized_data)and DTSTAMP changes every time, every event appears modified on every refresh — even if nothing actually changed.For a Google Calendar subscription with 2,621 events refreshed every ~15 minutes, this generates ~189K false change rows per day in
oc_calendarchanges.Reported at: #51120 (comment)
Approach
Instead of stripping DTSTAMP from the VObject (which would remove a required property from stored data), the fix strips DTSTAMP lines from a copy of the serialized string used only for etag computation:
The stored calendar data (
$sObject) is completely unchanged.Test plan
testDtstampChangeDoesNotTriggerUpdateverifies a DTSTAMP-only change does not triggerupdateCalendarObjectidenticalDataProvideretag computation to match the new DTSTAMP-stripped hashingRefreshWebcalServiceTestunit testsFixes: #51120
🤖 Generated with Claude Code